Skip to content

fix: Make DiscoveryMatch.label optional for non-sensitive/ignore matches#22

Merged
jiatolentino merged 1 commit into
datamasque:1.1.1from
jiatolentino:DM-2712-mongodb-discovery-support
Jun 24, 2026
Merged

fix: Make DiscoveryMatch.label optional for non-sensitive/ignore matches#22
jiatolentino merged 1 commit into
datamasque:1.1.1from
jiatolentino:DM-2712-mongodb-discovery-support

Conversation

@jiatolentino

Copy link
Copy Markdown
Contributor

A non-sensitive or ignored discovery match carries no sensitivity label, but DiscoveryMatch
required label: str. Parsing schema-discovery results that contained such a match (for example a
scope.non_sensitive column, reached via the generate_ruleset path) raised a pydantic
ValidationError. The schema_discovery CSV path never deserialised the model, so this stayed
latent until MongoDB document discovery exercised it.

This applies the same treatment already given to FileDiscoveryMatch.label, completing it for
schema discovery.

  • DiscoveryMatch.label is now Optional[str] = None.
  • Release 1.1.1 (HISTORY.rst, pyproject.toml, setup.cfg, and the uv.lock self-version).

Verified: ruff clean, and a DiscoveryMatch constructed without a label now parses (label is
None).

A non-sensitive or ignore discovery match carries no sensitivity label, but
DiscoveryMatch required `label: str`, so parsing schema-discovery results that
contained such a match (e.g. a scope.non_sensitive column, hit via the
generate_ruleset path) raised a pydantic ValidationError. The schema_discovery
CSV path never parsed the model, so this was latent until MongoDB document
discovery exercised it.
@jiatolentino jiatolentino self-assigned this Jun 24, 2026
@jiatolentino jiatolentino marked this pull request as ready for review June 24, 2026 05:27
@cph-datamasque

Copy link
Copy Markdown
Collaborator

As discussed, you've got other changes to merge in + I've got some bugfixes to add as well, so you're going to create a dedicated "1.1.1" branch in this repo for that.

@jiatolentino jiatolentino force-pushed the DM-2712-mongodb-discovery-support branch from c4362c8 to 116dbaf Compare June 24, 2026 21:49
@jiatolentino jiatolentino changed the base branch from main to 1.1.1 June 24, 2026 21:53
@jiatolentino jiatolentino merged commit ae09d24 into datamasque:1.1.1 Jun 24, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants